import request from '@/utils/request'
import type {User} from "@/api/book";

export interface WXLoginParam {
  code: string
}
export interface WXLoginPathParam {
  appid: string
}
export interface Notif{
  nId: number
  title: string
  content: string
  createTime: string
  updateTime: string
  viewStatus: 0 | 1
  viewTime: string
}
export const wxLogin = (data: WXLoginParam, repObj: WXLoginPathParam) => {
  return request<WXLoginParam,WXLoginPathParam,User>('/wx/user/{appid}/login', 'GET', {data: data, repObj: repObj,noToken: true})
}
export interface UserInfoParam {
  name: string
  headUrl: string
}
export const saveUserInfo = (uId:string,data: UserInfoParam) => {
  return request<UserInfoParam,{uId: string},User>('/user/saveInfo/{uId}', 'PUT', { data: data,noToken: true,repObj:{uId}})
}